3.7 \(\int (a+a \cos (c+d x)) \sec (c+d x) \, dx\)

Optimal. Leaf size=16 \[ \frac{a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0201203, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.118, Rules used = {2735, 3770} \[ \frac{a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+a \cos (c+d x)) \sec (c+d x) \, dx &=a x+a \int \sec (c+d x) \, dx\\ &=a x+\frac{a \tanh ^{-1}(\sin (c+d x))}{d}\\ \end{align*}

Mathematica [A]  time = 0.0072224, size = 16, normalized size = 1. \[ \frac{a \tanh ^{-1}(\sin (c+d x))}{d}+a x \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Maple [A]  time = 0.055, size = 30, normalized size = 1.9 \begin{align*} ax+{\frac{a\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{ca}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+cos(d*x+c)*a)*sec(d*x+c),x)

[Out]

a*x+1/d*a*ln(sec(d*x+c)+tan(d*x+c))+1/d*c*a

________________________________________________________________________________________

Maxima [A]  time = 1.19116, size = 38, normalized size = 2.38 \begin{align*} \frac{{\left (d x + c\right )} a + a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="maxima")

[Out]

((d*x + c)*a + a*log(sec(d*x + c) + tan(d*x + c)))/d

________________________________________________________________________________________

Fricas [B]  time = 1.72294, size = 95, normalized size = 5.94 \begin{align*} \frac{2 \, a d x + a \log \left (\sin \left (d x + c\right ) + 1\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x + a*log(sin(d*x + c) + 1) - a*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

Sympy [A]  time = 4.94182, size = 49, normalized size = 3.06 \begin{align*} a x + a \left (\begin{cases} \frac{x \tan{\left (c \right )} \sec{\left (c \right )}}{\tan{\left (c \right )} + \sec{\left (c \right )}} + \frac{x \sec ^{2}{\left (c \right )}}{\tan{\left (c \right )} + \sec{\left (c \right )}} & \text{for}\: d = 0 \\\frac{\log{\left (\tan{\left (c + d x \right )} + \sec{\left (c + d x \right )} \right )}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x)

[Out]

a*x + a*Piecewise((x*tan(c)*sec(c)/(tan(c) + sec(c)) + x*sec(c)**2/(tan(c) + sec(c)), Eq(d, 0)), (log(tan(c +
d*x) + sec(c + d*x))/d, True))

________________________________________________________________________________________

Giac [B]  time = 1.46839, size = 58, normalized size = 3.62 \begin{align*} \frac{{\left (d x + c\right )} a + a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="giac")

[Out]

((d*x + c)*a + a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d